import Vue from 'vue'
import Router from 'vue-router'

const Login = () => import ('@/views/login/login')
const Home = () => import ('@/components/home.vue')
// 设置菜单
const Personmesg = () => import ('@/views/set/personmesg.vue')
const Companymesg = () => import ('@/views/set/companymesg.vue')
const Communication = () => import ('@/views/set/communication.vue')
const Equipmentcompany = () => import  ('@/views/set/equipmentcompany.vue');
const Rask = () => import  ('@/views/set/rask.vue');
const Staffmesg = () => import  ('@/views/set/staffmesg.vue');
//监管菜单
const Supervise = () => import  ('@/views/supervise/supervise.vue');
//房屋菜单
const House = () => import  ('@/views/house/house.vue');
const Housedetails = () => import  ('@/views/house/housedetails.vue');
//客户菜单
const Customer = () => import  ('@/views/customer/customer.vue');
const Customerdetails = () => import ('@/views/customer/Customerdetails.vue');
//工单菜单
const Orderall = () => import  ('@/views/order/orderall.vue');
const Orderdetails = () => import  ('@/views/order/orderdetails.vue');

//呼叫中心
const History = () => import  ('@/views/oncall/history.vue');
const Historydetails = () => import  ('@/views/oncall/historydetails.vue');
const Oncall = () => import  ('@/views/oncall/oncall.vue');
//监控地图
const Map = () => import  ('@/views/map/map.vue');
const Scan = () => import  ('@/views/scan.vue');

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      redirect:'/Login'
    },
    {
      path: '/Login',
      name: '登录',
      component: Login
    },
    {
      path: '/scan',
      name: '扫码',
      component: Scan
    },
    {
      path: '/home',
      name: '首页',
      component: Home,
      children: [//设置菜单路由
        {
          path: '/',
          name: '个人信息',
          component: Personmesg
        },
        {
          path: 'companymesg',
          name: '公司信息',
          component: Companymesg
        },

        {
          path: 'communication',
          name: '沟通记录',
          component: Communication
        },
        {
          path: 'equipmentcompany',
          name: '设备生产公司',
          component: Equipmentcompany
        },
        {
          path: 'rask',
          name: '任务类型设置',
          component: Rask
        },
        {
          path: 'map',
          name: '维修人员',
          component: Map
        },
        {
          path: 'staffmesg',
          name: '人员设置',
          component: Staffmesg
        },
        {
          path: 'supervise',
          name: '监管中心',
          component: Supervise
        },
        {
          path: 'house',
          name: '房屋中心',
          component: House
        },
        {
          path:'housedetails',
          name: '房屋详情',
          component: Housedetails
        },
        {
          path: 'customer',
          name: '客户中心',
          component: Customer
        },
        {
          path:'customerdetails',
          name: '客户详情',
          component: Customerdetails
        },
        {
          path:'orderall',
          name: '全部工单',
          component: Orderall
        },
        {
          path:'orderdetails',
          name: '工单详情',
          component: Orderdetails
        },
        {
          path:'history',
          name:'历史通话',
          component: History
        },{
          path:'historydetails',
          name:'历史通话详情',
          component: Historydetails
        },
        {
          path:'oncall',
          name:'呼叫中心',
          component: Oncall
        }
      ]
    }
  ]
})

